#include <unistd.h>
#include <nss.h>
#include <syslog.h>

// Called to open the passwd file
enum nss_status
_nss_yang_setpwent(void)
{
    syslog(LOG_ERR, "_nss_yang_setpwent");
    return NSS_STATUS_UNAVAIL;
}

// Called to close the passwd file
enum nss_status
_nss_yang_endpwent(void)
{
    syslog(LOG_ERR, "_nss_yang_endpwent");
    return NSS_STATUS_UNAVAIL;
}

// Called to look up next entry in passwd file
enum nss_status
_nss_yang_getpwent_r(struct passwd *result, char *buffer, size_t buflen, int *errnop)
{
    syslog(LOG_ERR, "_nss_yang_getpwent_r");
    return NSS_STATUS_UNAVAIL;
}

enum nss_status
_nss_yang_getpwuid_r(uid_t uid, struct passwd *result, char *buffer, size_t buflen, int *errnop)
{
    syslog(LOG_ERR, "_nss_yang_getpwuid_r");
    return NSS_STATUS_NOTFOUND;
}

// Find a passwd by name
enum nss_status
_nss_yang_getpwname_r(const char *name, struct passwd *result, char *buffer, size_t buflen, int *errnop)
{
    syslog(LOG_ERR, "_nss_yang_getpwname_r");
    return NSS_STATUS_UNAVAIL;
}